//
//  movieCell.m
//  项目一
//
//  Created by nick on 15/7/20.
//  Copyright (c) 2015年 nick. All rights reserved.
//

#import "movieCell.h"
#import "UIImageView+WebCache.h"
#import "stars.h"
@implementation movieCell

- (void)awakeFromNib {
    // Initialization code
    
}
- (void)setModal:(movieRank *)modal{
    _modal = modal;
    [self setNeedsLayout];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.titleLable.text = _modal.title;
   // NSLog(@"%@",_modal.title);
    self.yearLable.text = [NSString stringWithFormat:@"年份：%@",_modal.year];
    self.averageLable.text = [NSString stringWithFormat:@"%.1f",_modal.average];
    NSDictionary *dic = _modal.images;
    [_iconimageView sd_setImageWithURL:[NSURL URLWithString:[dic valueForKey:@"small"]] placeholderImage:[UIImage imageNamed:@"msg_new"]];
    
    stars *s = [[stars alloc]initWithFrame:CGRectMake(0, 0, _stars.frame.size.width, _stars.frame.size.height)];
    s.average = _modal.average;
    [_stars addSubview:s];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
